<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<head>
    <meta charset="UTF-8">
    <title>题目讨论区</title>
    <script src="${pageContext.request.contextPath}/dist/jquery/jquery-3.4.1.min.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/dist/bootstrap/css/bootstrap.css">
    <script src="${pageContext.request.contextPath}/dist/bootstrap/js/bootstrap.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/programComment.css">
</head>
<body>
<jsp:include page="../public/header.jsp"/>
<div class="content-wrapper">
    <div id="base_content">
        <div class="container">
            <div class="row">
                <div class="col-md-5 col-md-offset-1 question_title">
                    <!--题目名-->
                    <h3>
                        <span>${sessionScope.program.programId}.</span>
                        <span>${sessionScope.program.programTitle}</span>
                    </h3>
                </div>
                <div class="col-md-5 question_btn">
                    <button class="btn btn-info" id="returnList">返回题目页面</button>
                </div>
            </div>
            <div class="row">
                <div class="col-md-8 col-md-offset-2 topAndTips">
                    <h4>题干信息：</h4>
                    <p>${sessionScope.program.programDesc}</p>
                </div>
            </div>
            <div class="row">
                <div class="col-md-8 col-md-offset-2 topAndTips">
                    <h4>参考代码：<span>${sessionScope.program.programLanguage}</span></h4>
                    <p>${sessionScope.program.programAnsContent}</p>
                </div>
            </div>
            <div class="row">
                <div class="col-md-8 col-md-offset-2">
                    <%--添加回复--%>
                    <div class="addReply reply">
                        <div contenteditable="true"></div>
                        <span class="btn" onclick="replyMsg(this)">回复</span>
                    </div>
                    <%--回复的显示区--%>
                    <c:forEach var="comment" items="${requestScope.commentList}">
                        <div class="reply">
                            <img class="headImg" src="${comment.customer.customerHeadImg}" alt="头像">
                            <div class="sub">
                                <p class="customerName">
                                    <a href="">${comment.customer.customerName}</a>
                                </p>

                                <p class="commentContent">
                                    <span>${comment.programComment.programCommentContent}</span>
                                </p>
                                <p class="spanBox">
                                    <span>
                                        <fmt:formatDate value="${comment.programComment.programCommentTime}"
                                                        pattern="yyyy-MM-dd"/>
                                    </span>
                                </p>
                            </div>
                        </div>
                    </c:forEach>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    let programId = "${requestScope.programId}";
</script>
<script src="${pageContext.request.contextPath}/js/programComment.js"></script>
<jsp:include page="../public/footer.jsp"/>
</body>